package com.alliky.cart.ui.viewmodel;

import android.graphics.drawable.Drawable;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.databinding.ObservableField;

import com.alliky.cart.R;
import com.alliky.core.entity.vo.GoodsVO;
import com.alliky.core.base.ItemViewModel;

/**
 * @Author: wxianing
 * @CreateDate: 2022/8/1 23:04
 * @Description: java类作用描述
 */
public class RecommendItemViewModel extends ItemViewModel<CartViewModel> {

    public ObservableField<GoodsVO> mGoodsVO = new ObservableField<>();
    public ObservableField<String> name = new ObservableField<>();

    public Drawable mDrawable;


    public RecommendItemViewModel(@NonNull CartViewModel viewModel, GoodsVO goodsVO) {
        super(viewModel);
        this.mGoodsVO.set(goodsVO);
        mDrawable = ContextCompat.getDrawable(viewModel.getApplication(), R.mipmap.icon_default);
    }


    //item点击事件
//    public BindingCommand onItemClick = new BindingCommand(new BindingAction() {
//        @Override
//        public void call() {
//            GoodsVO goodsVO1 = mGoodsVO.get();
//
//            Messenger.getDefault().send(goodsVO1.getGoods_name(), "1111");
//
//        }
//    });
}
